package com.sanbi.demo.bootadmin.server.controller;

import com.sanbi.demo.bootadmin.server.bean.User;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 江南一点雨
 * @Site www.javaboy.org 2019-06-05 9:38
 */
@RestController
@RequestMapping("user")
public class UserController {
    @GetMapping("getUserById")
    public User getUserById(Integer id) {
        User user = new User();
        user.setId(id);
        return user;
    }

    @PutMapping("updateUsernameById")
    public User updateUsernameById(String username, Integer id) {
        User user = new User();
        user.setId(id);
        user.setUsername(username);
        return user;
    }

    @PostMapping("addUser")
    public User addUser(@RequestBody User user) {
        return user;
    }

    @DeleteMapping("deleteUserById/{id}")
    public void deleteUserById(@PathVariable Long id) {

    }

    @GetMapping("hello")
    public String hello(String name) {
        return "hello " + name + " !";
    }
}
